package com.example.demo.Controller;

import com.example.demo.Service.ArkServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class BotController {

    @Autowired
    private ArkServiceClient arkServiceClient;

    @CrossOrigin
    @GetMapping("/chat")
    public String chatWithBot(@RequestParam String botId, @RequestParam String userId, @RequestParam String userMessage) {
        // 调用 ArkServiceClient 获取聊天响应，并返回给用户
        return arkServiceClient.getBotResponse(botId, userId, userMessage);
    }
}
